package cn.snailhd.core.base.constant;


public enum MessageEnums {
   
	
	
	DECRYPT_FAIL("1002","解密失败"),
	REQUEST_PARAM_ERROR("1003","请求参数格式有误"),
	
	
	
	
	LOGIN_USER_NOT_EXISTS("1101","用户不存在"),
	LOGIN_USER_PWD_ERROR("1102","账户密码错误"),
	
	REGISTER_TEL_EXISTS("1103","手机号已经被注册"),
	REGISTER_EMAIL_EXISTS("1104","手机号已经被注册"),
	
	LOGIN_LOSE("-1","登陆已失效"),
	
			
	;
	//错误编码
	private String errorCode;
	//提示信息
	private String msg;
	
	public String getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	

	private MessageEnums(String errorCode,String msg) {
        this.errorCode = errorCode;
        this.msg = msg;
    }

		
	public static MessageEnums getMessageEnum(String code) {
		for (MessageEnums option : MessageEnums.values()) {
			if (option.getErrorCode().equals(code)) {
				return option;
			}
		}
		return null;
	}
	
	
//	public static void main(String[] args) {
//        MessageEnum code = MessageEnum.DECRYPT_FAIL;
//        System.out.println(code.getLogMsg());
//        System.err.println(code);
//    }
}
